/**
 * 
 */
package t4j.typeinfo;

/**
 * @author sz
 *
 * create time：2012-12-14
 */
class Building{}

class House extends Building{}

public class ClassCasts {

	public static void main(String[] args) {
		Building b = new House();
		
		Class<House> houseType = House.class;
		
		House h = houseType.cast(b);//将其转为Class引用的类型
		
		House test = houseType.cast(new Integer(1));//但不会有类型检查，转换失败会报错
		
		h= (House) b;
	}
}
